<?php

namespace app\common\model\xiluhouse;

use think\Model;

class RentalOrderHouse extends Model
{
    

    // 表名
    protected $name = 'xiluhouse_rental_order_house';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        //'house_tag_text_arr'
    ];

    public function getHouseTagTextArrAttr($value,$data){
        $value = $value ? $value : (isset($data['house_tag_text']) ? $data['house_tag_text'] : '');
        $arr = [];
        if ($value) {
            $arr = explode(',',$value);
        }
        return $arr;
    }

}
